function getNowTime() {
  const now = new Date();
  // 获取年、月、日、时、分、秒
  let year = now.getFullYear();
  let month = String(now.getMonth() + 1).padStart(2, '0'); // 月份是从0开始的
  let day = String(now.getDate()).padStart(2, '0');
  let hour = String(now.getHours()).padStart(2, '0');
  let minute = String(now.getMinutes()).padStart(2, '0');
  let second = String(now.getSeconds()).padStart(2, '0');
  // 拼接成YYYY-MM-DD HH:MM:SS格式
  return `${year}-${month}-${day} ${hour}:${minute}:${second}`;
}

// 根据需要写入的字段进行遍历，添加问号
function addSqlStr(str) {
  let addStr = ''
  const strArr = str.split(',')
  strArr.forEach((item, index) => {
    addStr = index === 0 ? `?` : `${addStr},?`
  })
  return addStr
}


exports.getNowTime = getNowTime
exports.addSqlStr = addSqlStr
